<?php

/**
 * main.php
 * This file holds the configuration settings of your backend application.
 * */
$backendConfigDir = dirname(__FILE__);

$params = require_once($backendConfigDir . DIRECTORY_SEPARATOR . 'params.php');

// Setup some default path aliases. These alias may vary from projects.
Yii::setPathOfAlias('root', ROOT);
Yii::setPathOfAlias('common', ROOT . DIRECTORY_SEPARATOR . 'common');
Yii::setPathOfAlias('backend', ROOT . DIRECTORY_SEPARATOR . 'backend');
Yii::setPathOfAlias('frontend', ROOT . DIRECTORY_SEPARATOR . 'frontend');
/* uncomment if you need to use frontend folders */
/* Yii::setPathOfAlias('frontend', $root . DIRECTORY_SEPARATOR . 'frontend'); */

return array(
    'name' => 'Zocert',
    // @see http://www.yiiframework.com/doc/api/1.1/CApplication#basePath-detail
    'basePath' => $backendConfigDir . DIRECTORY_SEPARATOR . '..',
    // set parameters
    'params' => $params,
    // preload components required before running applications
// @see http://www.yiiframework.com/doc/api/1.1/CModule#preload-detail
    'preload' => array('bootstrap', 'log'),
    // @see http://www.yiiframework.com/doc/api/1.1/CApplication#language-detail
    'language' => 'en',
    // using bootstrap theme ? not needed with extension
//		'theme' => 'bootstrap',
// setup import paths aliases
// @see http://www.yiiframework.com/doc/api/1.1/YiiBase#import-detail
    'import' => array(
        'common.components.*',
        'common.components.helpers.*',
        //loading model
        'common.models.*',
        'common.models.object.*',
        'common.models.admin.*',
        'common.models.user.*',
        'common.models.order.*',
        'common.models.package.*',
        'common.models.emailtemplate.*',
        'common.extensions.yii-mail.YiiMailMessage',

        'frontend.protected.models.*',
        
        'application.components.*',
        'application.components.action.*',
        'application.models.*'
    ),
    'defaultController' => 'site',
    'components' => array(
        'mail' => array(
            'class' => 'common.extensions.yii-mail.YiiMail',
            'transportType' => 'php',
            'viewPath' => '',
            'logging' => true,
            'dryRun' => false
        ),
        'user' => array(
// enable cookie-based authentication
            'allowAutoLogin' => true,
            'class' => 'WebAdmin'
        ),
        /* load bootstrap components */
        'bootstrap' => array(
            'class' => 'common.extensions.bootstrap.components.Bootstrap',
            'coreCss' => false
        ),
        'errorHandler' => array(
// @see http://www.yiiframework.com/doc/api/1.1/CErrorHandler#errorAction-detail
//'errorAction' => 'site/error'
        ),
        'db' => $params['db.connect'],
        'urlManager' => array(
            'urlFormat' => 'path',
            'urlSuffix' => '',
            'showScriptName' => false,
            #'baseUrl' => 'http://localhost/',
            'rules' => $params['url.rules']
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
                // uncomment the following to show log messages on web pages
                array(
                    'class' => 'CWebLogRoute',
                    'levels' => 'trace, info, error, warning',
                ),
            ),
        ),
        'cache' => $params['cache.file'],
        'settings' => $params['settings'],
        'image' => array(
            'class' => 'common.extensions.image.CImageComponent',
            // GD or ImageMagick
            'driver' => 'GD',
            // ImageMagick setup path
            'params' => array('directory' => 'imagemagick directory'),
        ),
        // get format detail
        'format' => $params['format']
    /* make sure you have your cache set correctly before uncommenting */
    /* 'cache' => $params['cache.core'], */
    /* 'contentCache' => $params['cache.content'] */
    ), //end components
    'modules' => array(
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => false,
            'generatorPaths' => array(
                'bootstrap.gii'
            ),
        ),

    )
);